<?php

?>

<!--  Menu  -->
<ul id="mainMenu" class="topmenu menu">

  <?php 
  // define some empty vars for passing to method for code readability (rather than passing 'null')
  $linkArgs     = null;
  $separateArgs = null;
  $subList      = null;

  // Top-level menu item: "Home" (house icon only)
  $linkDisplayStr = '';  // use icon only
  $tooltip = 'Home';
  $iconPath = 'Icons/White/Circle/24x24/home2.png'; 
  $linkToController = "jobs";
  $linkToMethod     = "index";
  $isFirstTopMenuItem = true;
  $isLastTopMenuItem  = false;

  echo $this->Menu->makeListItem($linkToController, $linkToMethod, $linkArgs, $separateArgs,
                        $isFirstTopMenuItem,$isLastTopMenuItem, $linkDisplayStr, $tooltip, $iconPath );    

  // ---------------------------------------
  // "Find" list item (also has submenu items)
  // First need to make SUBMENU <ul> 
  // Submenu item: "Job by Date" (find a job by recently created or modified)
  $linkDisplayStr = 'Job by Date';
  $tooltip = '';
  $iconPath = 'Icons/White/Circle/32x32/calendar.png'; 
  $linkToController = 'jobs';
  $linkToMethod     = 'index';
  $isFirstTopMenuItem = false;
  $isLastTopMenuItem  = false;

  $subLi1 = $this->Menu->makeListItem($linkToController, $linkToMethod, $linkArgs, $separateArgs,
                        $isFirstTopMenuItem,$isLastTopMenuItem, $linkDisplayStr, $tooltip, $iconPath );
  
  // Submenu item: "Job by Group" (find a job by looking at job group list)
  $linkDisplayStr = 'Job by Group';
  $tooltip = '';
  $iconPath = 'Icons/White/Circle/32x32/messanger.png'; 
  $linkToController = 'job_groups';
  $linkToMethod     = 'index';
  $isFirstTopMenuItem = false;
  $isLastTopMenuItem  = false;

  $subLi2 = $this->Menu->makeListItem($linkToController, $linkToMethod, $linkArgs, $separateArgs,
                      $isFirstTopMenuItem,$isLastTopMenuItem, $linkDisplayStr, $tooltip, $iconPath );
  // Assemble the submenu <li>'s into one <ul> to complete the submenu list
  $subList = "<ul>\n $subLi1\n $subLi2\n</ul>";

  // Now create the top-level <li>, and pass in the sublist <ul>
  // Top-level menu item: "Create"
  $linkDisplayStr = 'Find';
  $tooltip = '';
  $iconPath = 'Icons/White/Circle/24x24/search.png'; 
  $linkToController = "";
  $linkToMethod     = "";
  $isFirstTopMenuItem = false;
  $isLastTopMenuItem  = false;

  echo $this->Menu->makeListItem($linkToController, $linkToMethod, $linkArgs, $separateArgs,
                        $isFirstTopMenuItem,$isLastTopMenuItem, $linkDisplayStr, $tooltip, $iconPath, $subList);   
  // -------- end Top-level and sub-level list items for "Find" ------------------------------
  // -------------------------------------------------------------------------------------------


  // ---------------------------------------
  // "Create" list item (also has submenu items)
  // First need to make submenu <ul> 
  // Submenu item: "Job" (create job)
  $linkDisplayStr = 'Job';
  $tooltip = '';
  $iconPath = 'Icons/White/Circle/32x32/messanger_single.png'; 
  $linkToController = 'jobs';
  $linkToMethod     = 'form';
  $isFirstTopMenuItem = false;
  $isLastTopMenuItem  = false;

  $subLi1 = $this->Menu->makeListItem($linkToController, $linkToMethod, $linkArgs, $separateArgs,
                        $isFirstTopMenuItem,$isLastTopMenuItem, $linkDisplayStr, $tooltip, $iconPath );  
  // Submenu item: "Job Group" (create job group)
  $linkDisplayStr = 'Job Group';
  $tooltip = '';
  $iconPath = 'Icons/White/Circle/32x32/messanger.png'; 
  $linkToController = 'job_groups';
  $linkToMethod     = 'form';
  $isFirstTopMenuItem = false;
  $isLastTopMenuItem  = false;

  $subLi2 = $this->Menu->makeListItem($linkToController, $linkToMethod, $linkArgs, $separateArgs,
                      $isFirstTopMenuItem,$isLastTopMenuItem, $linkDisplayStr, $tooltip, $iconPath );  
  // Assemble the <li>'s into one <ul>
  $subList = "<ul>\n $subLi1\n $subLi2\n</ul>";

  // Now create the top-level <li>, and pass in the sublist
  // Top-level menu item: "Create"
  $linkDisplayStr = 'Create';
  $tooltip = '';
  $iconPath = 'Icons/White/Circle/24x24/plus.png'; 
  $linkToController = "";
  $linkToMethod     = "";
  $isFirstTopMenuItem = false;
  $isLastTopMenuItem  = false;

  echo $this->Menu->makeListItem($linkToController, $linkToMethod, $linkArgs, $separateArgs,
                        $isFirstTopMenuItem,$isLastTopMenuItem, $linkDisplayStr, $tooltip, $iconPath, $subList);  
  // -------- end Top-level and sub-level list items for "Create" ------------------------------
  // -------------------------------------------------------------------------------------------

  // "Explore" top-level list item
  $linkDisplayStr = 'Explore';
  $tooltip = '';
  $iconPath = 'Icons/White/Circle/24x24/folder.png'; 
  $linkToController = '';  // TODO: make this link launch Elfinder (via jQuery Modal?)
  $linkToMethod     = '';
  $isFirstTopMenuItem = false;
  $isLastTopMenuItem  = false;
  $subList = null;
  $linkOptions = array('rel' => '#file_exp_container'); // needed for jQuery Tools modal overlay trigger

  echo $this->Menu->makeListItem($linkToController, $linkToMethod, $linkArgs, $separateArgs,
                        $isFirstTopMenuItem,$isLastTopMenuItem, $linkDisplayStr, $tooltip, $iconPath,
                        $subList, $linkOptions);  


  // Top-level menu item: "About/Help" ("?" icon only)
  $linkDisplayStr = '';  // use icon only
  $tooltip = 'About/Help';
  $iconPath = 'Icons/White/Circle/24x24/help.png'; 
  $linkToController = "jobs";
  $linkToMethod     = "help";
  $isFirstTopMenuItem = false;
  $isLastTopMenuItem  = true;

  echo $this->Menu->makeListItem($linkToController, $linkToMethod, $linkArgs, $separateArgs,
                        $isFirstTopMenuItem,$isLastTopMenuItem, $linkDisplayStr, $tooltip, $iconPath);  

  ?>

</ul>
<!-- end Menu -->